package com.bdqn.t350.ch11;


import com.bdqn.t350.ch11.mapper.RoleRightMapper;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;
import java.util.HashSet;
import java.util.Set;

@RunWith(SpringRunner.class)
@SpringBootTest
public class RoleRightMapperTester {

    @Resource
    RoleRightMapper roleRightMapper;

    /**
     * 批量添加
     */
    @Test
    public void batchInsertTester() {
        Set<String> rightSet = new HashSet<>();
        //rightSet.add("L0404");
        rightSet.add("L0401");
        rightSet.add("L0403");
        int i = roleRightMapper.batchInsert(rightSet, 1);
        System.out.println(i);
    }

    /**
     * 批量删除
     */
    @Test
    public void deleteByIdsTester() {
        Set<String> rightSet = new HashSet<>();
        rightSet.add("L0404");
        rightSet.add("L0401");
        rightSet.add("L0403");
        int i = roleRightMapper.deleteByIds(rightSet, 1);
        System.out.println(i);
    }
}
